<?php
/**
 * Created by Silent Night.
 * Author: Silent Night
 * email: silentwolf_wp@163.com
 * Date: 2017/9/28
 * Time: 9:19
 */

namespace app\admin\controller;

use think\Controller;
use think\Db;
use think\Session;

class Relationselect extends Controller
{

    private $pagesize = 6;

    public function _initialize()
    {
        $this->assign('LoginUserInfo', $this->LoginUserInfo);
        //获取当前用户的权限信息
        $this->assign('ruleLists', $this->LoginUserInfo['CurrPower']);
    }

    public function select()
    {

        $msgshow = trim(input("request.msgshow"));
        $dataString = trim(input("request.dataString"));
        //获取文章列表开始
        $allRelationSelectResult = json_decode($dataString,true);


        //获取文章列表结束
        $this->assign('dataString', $dataString);
        $this->assign('allRelationSelectResult', $allRelationSelectResult);
        $this->assign('msgshow', $msgshow);
        return view('select');
    }

    public function selectData()
    {
        $where['is_delete'] = '0';
        $mode = new  \app\admin\model\Shop();
        $lists = $mode->lists($where, $this->pagesize);
        $lists['data'] = changeUidToUserinfoForLists($lists['data'], 'uid');
        $lists['data'] = filterHtmlForLists($lists['data']);
        $lists['data'] = (new \app\admin\mapper\Common())->listMapper($lists['data']);
        $return['err'] = 0;
        $return['msg'] = '成功';
        $return['data'] = $lists;
        return json($return);

    }

}